b973852a59b8e36dc3ae616193189747d630143f,plugin_ide.core/src-lang/melnorme/lang/ide/core/operations/LangProjectBuilder.java,LangProjectBuilder,build,#number#Map#IProgressMonitor#,153
Before Change
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
assertTrue(kind != CLEAN_BUILD);
IProject project = assertNotNull(getProject());
try {
prepareForBuild(monitor);
return doBuild(project, kind, args, monitor);
}
catch(OperationCancellation cancel) {
forgetLastBuiltState();
After Change
}
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
assertTrue(kind != CLEAN_BUILD);
if(kind == IncrementalProjectBuilder.AUTO_BUILD) {
return null; // Ignore auto build
}
ArrayList2<IProject> referenced =
ArrayList2.createFrom(getContext().getAllReferencedBuildConfigs())
.map((buildConfig) -> buildConfig.getProject())
.filterx(new ArrayList2<>(), (project) -> project.hasNature(LangCore.NATURE_ID))
;
ArrayList2<IProject> referencing =
ArrayList2.createFrom(getContext().getAllReferencingBuildConfigs())
.map((buildConfig) -> buildConfig.getProject())
.filterx(new ArrayList2<>(), (project) -> project.hasNature(LangCore.NATURE_ID))
;
boolean firstCall = referenced.isEmpty();
ArrayList2<IProject> allOurProjects = referencing;
allOurProjects.add(getProject());
if(!firstCall) {
return null;
}
try {
EclipseUtils.execute_asCore(monitor, (om) -> {
EclipseJobOperation job = buildManager.requestMultiBuild(om, allOurProjects, false);
if(!runAsynchronousBuild()) {
try {
job.join();
} catch(InterruptedException e) {
throw new OperationCancellation();
}
}
});
return null;
}
catch(OperationCancellation cancel) {
return null;
} catch(CoreException ce) {
if(monitor.isCanceled()) {
// This shouldn't usually happen, a OperationCancellation should have been thrown,